cluster.name: {{ elasticsearc_uster_name }}

node.name: {{ nodename }}
node.master: true
node.data: true

path.data: {{ elasticsearch_data }}
path.logs: {{ elasticsearch_log }}

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

network.host: 0.0.0.0
transport.tcp.port: {{ elasticsearch_transport_port }}
http.port: {{ elasticsearch_port }}

cluster.initial_master_nodes: [{% for esip in groups.elasticsearch %} "{{ hostvars[esip]['nodename']}}",{% endfor %}]

{% if groups.elasticsearch | length > 1 %}
discovery.seed_hosts: [{% for esip in groups.elasticsearch %} "{{ esip }}:{{ elasticsearch_transport_port }}",{% endfor %}]
#total number of nodes / 2 + 1
discovery.zen.minimum_master_nodes: 2
discovery.zen.ping_timeout: 10s
{% endif %}

#Access-Control-Allow-Origin
http.cors.enabled: true
http.cors.allow-origin: "*"
